<div id="field_<?= $name ?>" class="field<? if (!empty($error)): ?> error<? endif; ?><? if ($is_ok): ?> ok<? endif ?>">
    <p><label for="id_field_<?= $name ?>"><?= $title ?><? if ($required): ?> <span class="required">*</span><? endif ?></label><? if (!empty($description)): ?><br/><span class="description"><?= $description ?></span><? endif ?></p>

    <div style="height:100px;">
        <img id="img_field_<?= $name ?>" src="<?= empty($this->vars['value']) ? "assets/snippets/mvc/data/workplace/avatar_100x100.jpg" : str_replace("webusers/$user_id/", "webusers/$user_id/tn_", $this->vars['value']) ?>" width="100" height="100" alt="Фотография drskip" style="float:left"/>

        <input type="hidden" name="<?= $name ?>" id="id_field_<?= $name ?>" value="<?= $this->vars['value'] ?>"/>

        <div class="image_control">
            <div><button id="remove_<?= $name ?>" class="<? if (empty($this->vars['value'])): ?>hide<? endif; ?>"><img src="/manager/media/style/MODxCarbon/images/icons/delete.png" alt=""/> Удалить</button></div>
            <div><button id="upload_<?= $name ?>"><img src="/manager/media/style/MODxCarbon/images/icons/b092.gif" alt=""/> Загрузить</button></div>
        </div>
    </div>

    <div id="photo_upload_<?= $name ?>" class="photo_upload">
        <div class="my_box">
            <!--form name="form" action="" method="POST"-->
                <h2>Загрузка фотографий</h2>
                <div class="inside_block">
                    <p>Пожалуйста выберите файл и нажмите &quot;Загрузить&quot;. Загруженное фото будет уменьшено до необходимых размеров.</p>

                    <input id="file_to_upload_<?= $name ?>" name="file_to_upload_<?= $name ?>" type="file" size="48" style="width: 400px;"  class="input"/>


                    <img id="loading" alt="Загрузка" src="assets/snippets/mvc/data/form/ajaxfileuploader/loading.gif" style="display:none;">
                </div>

                <div class="buttons">
                    <button class="submit_button ok_button" id="button_upload_<?= $name ?>" onclick="return ajax_file_upload();">Загрузить</button>
                    <button class="submit_button" onclick="jQuery.fancybox.close();return false;">Отменить</button>
                </div>
            <!--/form-->
        </div>

    </div>
    <span class="error" id="error_for_<?= $name ?>"><?= $error ?></span>
</div>
